package com.oak.interviewdemo.esayPoi;

import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import org.apache.poi.ss.usermodel.Workbook;

import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;

/**
 * @Author: guoxy
 * @Description:
 * @Date: 2020/6/2 13:18
 */
public class EasyPoi {

    public static void main(String[] args){


        ArrayList<StudentDto> list = new ArrayList<>();
        list.add(new StudentDto("1","lucy",1,new Date(),new Date()));
        list.add(new StudentDto("2","jack",1,new Date(),new Date()));
        list.add(new StudentDto("3","jim",0,new Date(),new Date()));
        Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams("计算机一班学生","学生"),
                StudentDto .class, list);

        // 导出操作
//        ExcelUtils.exportExcel(list, "easypoi导出功能", "导出sheet1", StudentDto.class, "测试user.xls", response);

    }

}